package com.kehutong.house.enums;

import org.coraframework.util.HashID;

public enum AccessControlType implements HashID {

    CARD_OPENING("1","刷卡开门"),
    QR_CODE ("2", "扫码开门"),
    REMOTE_OPENING("3", "远程开门"),
    FACE_RECOGNITION ("4", "人脸开门"),
    ;


    private final String id;
    private final String desc ;

    public static AccessControlType get(String id) {
        AccessControlType[] accessControlTypes = values();
        for (AccessControlType accessControlType : accessControlTypes) {
            if (accessControlType.getId().equals(id)) {
                return accessControlType;
            }
        }
        return null;
    }

    private AccessControlType(String id, String desc) {
        this.id = id;
        this.desc = desc ;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public String getDesc() {
        return desc;
    }
}
